from peewee import *

from bitget.dynamic_model_base import create_dynamic_model


def create_bitget_depth_n_model(name):
    # 定义字段
    fields = {
        'create_time': DateTimeField(),
        'currency_id': IntegerField(),
        'inst_id': CharField(),
        'direction': CharField(),
        'ranking': IntegerField(),
        'price': DecimalField(),
        'sz': DecimalField(),
        'ts': CharField()
    }

    # 动态创建名为name的表和对应的实体类
    return create_dynamic_model(name, fields)
